package com.ssmdemo01.controller;

import com.ssmdemo01.pojo.User;
import com.ssmdemo01.service.UserService;
import com.ssmdemo01.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    private UserService userService;

    @RequestMapping("test")
    @ResponseBody
    public Result test(){
        List<User> users = userService.queryUsers();
        return Result.build(200,users,"请求成功！！！");
    }

}
